﻿using Fetches.Fetch.Utils;

namespace Fetches.Fetch.Factory
{
    /// <summary>
    ///     这些信息由Factory决定以统一调度
    /// </summary>
    public class FactoryConfig : IJsonWriteable
    {
        /// <summary>
        ///     调度器,e.g Fetches.Fetch.Scheduler.RedisScheduler
        /// </summary>
        public string SchedulerType { get; set; }

        /// <summary>
        ///     调度器配置
        /// </summary>
        public string SchedulerConfig { get; set; }

        /// <summary>
        ///     页面快照池,e.g Fetches.Fetch.PagePool.InMemoryPagePool
        /// </summary>
        public string PagePoolType { get; set; }

        /// <summary>
        ///     页面快照池配置
        /// </summary>
        public string PagePoolConfig { get; set; }

        /// <summary>
        ///     二进制资源存储,e.g Fetches.Fetch.FileHosting.LocalFileHosting
        /// </summary>
        public string HostFileProviderType { get; set; }

        /// <summary>
        ///     二进制资源存储配置
        /// </summary>
        public string HostFileProviderConfig { get; set; }

        /// <summary>
        ///     二进制资源存储辅助，e.g Fetches.Fetch.Utils.KvStore.RedisKvStore
        /// </summary>
        public string HostFileKvStoreType { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string HostFileKvStoreConfig { get; set; }

        /// <summary>
        ///     代理池,e.g Fetches.Fetch.Proxy.IProxyPool
        /// </summary>
        public string ProxyPoolType { get; set; }

        /// <summary>
        ///     代理池配置
        /// </summary>
        public string ProxyPoolConfig { get; set; }

        /// <summary>
        ///     数据加工协调员,e.g Fetches.Fetch.PagePool.Consume.QueueProcessCoordinator
        ///     用于多线程消费PagePool的情况
        /// </summary>
        public string ProcessCoordinatorType { get; set; }

        /// <summary>
        ///     数据加工协调员配置
        /// </summary>
        public string ProcessCoordinatorConfig { get; set; }

        /// <summary>
        ///     存在疑问的，抓取完成自动退出的话消费的进程就在问题了
        /// </summary>
        public bool AutoShutdown { get; set; }
    }
}